<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Model\Goods;
use App\Model\Assess;
use DB;
use Auth;
use Redis;
class GoodsController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *商品的详细信息
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        
        $Goods = new Goods();
        //获取商品总信息
        $goods = $Goods->getGoods($id);
        //获取商品详细图片
        $img = $Goods->getImgs($id);
        //获取放大镜图片
        $imgs = $Goods->getImg($id);
        //获取评论列表
        $assess = $Goods->getAssess($id);
        // dd($assess);
        //获取评论数
        $assCount = $Goods->getCount($id);
        return view('home.goods_show')->with('goods',$goods)
                                      ->with('assess',$assess)
                                      ->with('assCount',$assCount)   
                                      ->with('img',$img)
                                      ->with('imgs',$imgs);
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }

   

  

}
